<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="Author" contect="http://www.cmtime.cn">
    <title>西北金行</title>
    <link rel="shortcut icon" href="images/favicon.ico" />
    
    {include file="public/link" /}
  </head>
  <body>
  {include file="public/header" /}
  <form class="layui-form" action="">
    <input type="hidden" name="id" value="{$shop.id}">
    <div class="maincont">
{if $class==1 }  
 <div class="dj_list" style=" padding:0;">
			<li style="background:url({$shop.img}) no-repeat;">
					<div class="gaoxiao"></div>
					<h1>{$shop.title}</h1>
					<h2>优惠价：<span>￥{$shop.pay}</span></h2>
					<p>开始时间：<time>{$shop.addtime}</time></p>
					<p>结束时间：<time>{$shop.overtime}</time></p>
			</li>
		</div>    
{else /}
<div id="sliderA" class="slider">
      <img src="{$shop.img}" />
     </div><!--sliderA/-->
{/if}	 
     <table class="jia-len">
      <tr>
       <th><strong class="orange">￥{$shop.pay}</strong></th>
       <td width="180">

        <div class="layui-inline">
          <label class="layui-form-label">数量</label>
          <div class="layui-input-inline"  style="width: 80px;">
            <select name="num">
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="5">5</option>
              <option value="6">6</option>
            </select>
          </div>
        </div>



       </td>
      </tr>
      <tr>
       <td colspan="2">
        <strong>{$shop.title}</strong>
        <p class="hui"></p>
       </td>
      
      </tr>
     </table>
     <div class="height2"></div>
     <div class="zhaieq">
       <a href="javascript:;" class="zhaiCur" style="width:100%; float:none; background:none; display:block;">商品简介</a>
      <div class="clearfix"></div>
     </div><!--zhaieq/-->
     <div class="proinfoList">
      {$shop.content}
     </div><!--proinfoList/-->
     <div class="proinfoList">
      暂无信息....
     </div><!--proinfoList/-->



    </div><!--maincont-->
    
    <!--pay-->
    <div class="gwcpiao">
     <table>
      <tr>
       <td width="60%" style="border-right: none;">总计：<strong class="orange">¥{$shop.pay}</strong></td>
       <td width="40%" style="border-left: none;">
          <button class="layui-btn jiesuan" lay-submit="" lay-filter="pay">去结算</button>
       </td>
      </tr>
     </table>
    </div>
    <!--pay-->
</form>
  {include file="public/footer" /}
  <script src="{$Assets}layui/layui.js"></script>




<script>
layui.use(['form', 'layedit', 'laydate','table'], function(){
   var form = layui.form
  ,layer = layui.layer
  ,$ = layui.jquery
  ,layedit = layui.layedit
  ,table = layui.table
  ,laydate = layui.laydate;
  
  var $ = layui.$, active = {
    
  };
  //监听提交
  form.on('submit(pay)', function(data){


              num=data.field.num;
                    $.ajax({
                        type:"POST",
                        url: "{:url('pay/order')}",
                        data:{num:num,id:{$shop.id}},
                        dataType:"text",

                        success:function(ret_datas){
                          if(ret_datas==1){
                            window.location.href='/pay/wxpay/example/jsapi.php';
                          }else if(ret_datas==0||ret_datas==10){
                            window.location.href='/index.php/index/login/index';
                          }else if(ret_datas==100){
                            layer.msg('货存不足');
                          }
                        }
                    });

    return false;
  });
 
   $('.gwcpiao .layui-btn').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
});
</script>



  </body>
</html>